fix toggling of the item which index before and after is the same