Added query string handling to urlFor function