FINALLY FIXED THE MEMORY LEAK