Appointment edit feature fixed - needs refactoring