error check on GenFile