changing to url.resolve
check path first for slash