trying to fix memory leak warning