fix bug in better error handeling of gen file
Merge pull request #250 from PatrickDeelen/master

fix bug in better error handeling of gen file