use diff length bug fix