added closure and update repl