Fix for null query