fix getSequence Logic