Updated Ajax to simplify the task retry process