add error event callback