fix query string to build query with null and empty string when the second parameter is null