fix edge case issue with query strings
Merge pull request #8 from liip/fix_query_string_handling

fix edge case issue with query strings