fixes cacheSolve function