Need help/hint of resolving invalid memory access