You should just be able to use url() here instead of appending the purl manually.