error handler minor bugfixes