improved error handling #4
Merge pull request #1 from novosga/master

improved error handling #4