Fix cache management
Added stuff for an example