Exit with code 1 when got errored tasks

Only after all tasks are done