replace use of retract with delete
(cherry picked from commit b6b3101b2d262821a4f5f03f2659dcfd2536a320)