fix switching sequence