instead of `fail` just check the array length at the end