fix file replace bug