replace use of retract with delete