ومتى أحدث الامام في الصلاة فلا بأس أن يقدم من يتم الصلاة بهم روى
And whenever the imam (of prayer) becomes invalidated (enters a state of hadath) during the prayer, there is no harm in him appointing someone to complete the prayer with the people. This is narrated: