fixed getNextNumber