Wrong variable was used.
Hash was used instead of original_hash.
Refactored some code for cloning.