fix remove domain membership bugs