move job to failed when error occures