fix for - ReferenceError: query is not defined