fix file extension replacement