fixed illegal memory access