Fix errorHandler handleError method