updated salesforce api code to work around changes in the query method