fix running job infinitely when attempts < 0