Conditional deactivate

I am sorry for being unable to use git.
This is a clean PR.
![like this](http://i.snag.gy/VROmO.jpg)