Add fail and error handlers