Make sure all 'off' functions run before 'on' functions