Revert "removed redundant code"

This reverts commit 8ea173b4f1841e328a7ba05bcb833b6bd0153e1d.