fix memory leak from orm