fixes switch context in REPL