add cache mechanism