format url function