Fix rename function