fix memory storage problem with reloaded entities