added a reset function to edit mode