fix nextSequence();