Possible fix for query error