removing last empty element in urls