button logic for returning from edit mode