sorted itemsLength issue