cleanup equality check on replace