fix some memory leak