Add error handler to map