Replace all occurrences of menu.state !== 'stopping' && menu.state !== 'stopped' with menu.state.indexOf( 'stop' ) === -1