Executing code when a mode is changed from another mode

See this bug: Mode change subscription bug, at least in docs