fix memory leak
added tests dtor