Add gen file number and delete used file

could cause incorrect filenum debug display