He reported God’s Messenger as saying, “Sonny, avoid turning to the side when you are engaged in prayer, for turning to the side produces destruction. If you must do it, do it in the voluntary, but not in the obligatory prayer.”
Abu Dharr reported God’s Messenger as saying, “God most high continues to turn favourably towards a servant while he is engaged in prayer as long as he does not look to the side, but if he does so He departs from him.”
Ahmad, Abu Dawud, Nasa’i and Darimi transmitted it.