fix a issue of memory leak