make switch context work