add saveEntities call