Fix trailingSlash bug