Keep track of wether agent is active

Shuts down all operations if it's not.