Fixed bug with double deactivate