moved replace_url to @request