Wrong placement of error handling function
Merge pull request #94 from floatdrop/master

Wrong placement of error handling function