fixed a bug when inserting a list into the middle of another list