fixed a bug in Cache.map