Memory leak corrected