added query in reports_controller and appointments model