change exitOnFail to onFailure