fix: accessing invalid memory region.