added caching in map