add on error event for client