fix replacement failure