find index of object to delete (to prevent id collision in certain circumstances)