improve root url handling