add error event listener