Fix a bug may cause url string ending up with "?".