cache handling improved

cache clearing for functions introduced