Add an action for mode changes