Defect fix on the named query