modified rename code.