fix bad deactivate bug