Fixed bug in cache controller