indexing by $key should not be necessary