Modified logic so that it fixes the 4 failures in CI