return next number, throw exception to stop