fix problum with memory leak