fix memory error in recreate