fix a bug when giving up ownership