fix the order by setting the index exactly instead of splicing