fix a few bugs around the URL