escape function when editing mode added