adding code to limit query sizes for gantt charts