iterator invalidated after erase fix