Fixed memory access violation issue through workaround.