fixed major memory leak

cachefile.close()