fix query in reports.py