dodgy error handler