changed a map to a key_replace