Revert "deleted some useless code"

This reverts commit ab0b9e3eb0a50455a1d4d9c313da63b0323ac58f.