handle error events bette