Fixing Memory Leak and indentation
Fixing memory leak