handle jobs errors correctly