fix entity_map write