added cache mechanism