Fixed Memory Leak Issues