(bug-fix) Fixed a memory leak