added sort_by_date to appt controller