improve the grammaticallity of the given text:
After he finished cleaning he thought that his wife will blame him after she saw what he had done.
After he had finished cleaning, he thought that his wife would blame him after she saw what he had done.