fix copy-replace error