added event handler to respond to escape key being pressed on the new/edit node modal