fixing fiducial replacement bug