fix bug: after R is restarted, debugger state doesn't always get reset