Revert "remove unnecessary code"

This reverts commit e6d9ead94a67bbc84e679b4660986b331a1279b9.