added deactivate function