bugfix in sequence_next()