Repair rename function