moved displayAppointments