some memory leak fix