Fixed the issue in cachesolve()