add exception handling to REPL