fix bug in better error handeling of gen file