fix error with empty strings
fix problem with empty query string