fixed Illegal state to remove