fix edge case issue with query strings