Fixes Memory Heap Corruption Error