factored out the url parameter check - still works afaik