add doc on error & end events