Fixed some memory leak