Fixed a memory leak