fix iterator manipulation on erase