Avoiding use-after-free - Deno