A man who intends to do a good deed, but is prevented from doing it, must be considered as if he had done it.