fix for query