fix memory leak in AI by Paracel