Fix for query stuff