Fixed Issue #71

Fixed broken error handling
Merge pull request #73 from pixelfreak/master

Fixed broken error handling in controller