added removeFile function at cache, and not saving files on error