fix a bug in url encoding