diff --git a/src/browser/html/location.zig b/src/browser/html/location.zig
index 31be5a6b..0e12f933 100644
--- a/src/browser/html/location.zig
+++ b/src/browser/html/location.zig
@@ -52,7 +52,7 @@ pub const Location = struct {
current_url;
const normalized_hash = std.mem.trimStart(u8, hash, "#");
- const new_url = try std.fmt.allocPrint(page.arena, "{s}#{s}", .{ base_without_hash, normalized_hash });
+ const new_url = try std.fmt.allocPrint(page.session.transfer_arena, "{s}#{s}", .{ base_without_hash, normalized_hash });
return page.navigateFromWebAPI(new_url, .{ .reason = .script }, .replace);
}
diff --git a/src/tests/html/location.html b/src/tests/html/location.html
index c39ecb6f..863ae658 100644
--- a/src/tests/html/location.html
+++ b/src/tests/html/location.html
@@ -13,3 +13,13 @@
testing.expectEqual("9582", location.port);
testing.expectEqual("", location.search);
+
+