fix url_for api compatibility issues