The Prophet (peace and blessings be upon him) forbade praying behind one who is talking or one who is sleeping.