Appends an element in a given index, and keeps it in that position