It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that once the Messenger of Allah (peace and blessings be upon him) led the prayer, then said: "O so-and-so! Why do you not perform your prayer well? Does the one who prays not consider, when he prays, how he is praying? He prays only for his own benefit. By Allah! I see what is behind me just as I see what is in front of me."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3583