Updated to create a proc if we are operating in an existing interpreter, to avoid setting local variables