removed memory leak err