fixed fgdb memory leak and delete old files