Revert "Removed unnecessary code"

This reverts commit 8a2108685bc4ae08079b81f93c5715625f40c7b2.