add on error event to client