Rahul VB wrote:
This happens when i remove something from the list and then try to add an item at a particular index
When you remove an item from list, you can't add another one on its index!
Let's say, a list contains:
1. Adam
2. Eve
3. Maciej
If second item has been removed, the list is:
1. Adam
2. Maciej
So... if you're trying to add new item on 2. position, you really overwrite existing one.
Think of it and change code to your needs. Tip: add element at the end of list and then move it.