fixes remove_index method