jshint corrections: added braces, turned off W098 for the errorHandler function