Fixed broken error handling in controller

Issue #71: Fixed broken error handling