Repaired memory leak