made the url generator location aware
fixed some syntax issues