Once, while Reb Elimelech of Lizensk and Reb Zushe of Anipoli were traveling with a group of vagabonds. Members of the group were accused of being thieves, resulting in the entire bunch being thrown into jail. Confident of their innocence and eventual release, the two brothers sat quietly. As the afternoon progressed, Rabbi Elimelech stood up to prepare himself to daven minchah:
Dear brother,it is forbidden to daven in this cell, because there is a pail that serves as a toilet nearby, making the room unfit for davening.
What are you doing?
I am getting ready to daven minchah.
Don’t you know that the same Hashem who commanded you to daven, also commanded you not to daven when the room is unfit for davening? By not davening in this room, you have achieved a connection with Hashem. True, it is not the connection that you had sought. Yet, if you truly want the divine connection, you would be happy that Hashem has afforded you the opportunity to obey His law at this time, no matter what it is.
Why are you crying?Is it because you can't daven?
But why weep?
Yes
You're right!
The feelings of dejection banished from his heart and mind. Rabbi Elimelech took his brother’s arm and began to dance from joy as a result of performing the mitzvah of not praying in an inappropriate place.