SOQL query fix