fixing bug when inserting element left, when position is at the end