fix bugs about memory leak
fix bugs about memory leak