protected String generateValidID() throws MessageStoreException {
String newID = generateID();
// Create a loop limit of 10^idsize
BigInteger limit = new BigInteger("10");
limit = limit.pow(globalConfig.getIdSize());
BigInteger count = new BigInteger("0");
BigInteger increment = new BigInteger("1");
// Repeat whilst the generated ID is invalid and the count < limit
while (!checkValidID(newID) && (count.compareTo(limit) < 0)) {