complete the logic for command use and deactivate