Add correct exit code based on the success of all the tasks