cach functionality debugged