escaping urls merged into one function