Update ownership and conditional drop of function