Updated shell script in order to not read task jobs that have failed