fixed issue with empty query fields