Fixed definition for queryRecords in controllers