fixed logic error in cacheSolve()