Fixed the haunting memory leak