make sure the index id is not nil