fixed bug caused when removing code