Instead of counting raise an exception from the loop if there are not enough versions