nit: Suggest to return the oldName directly options.parentNode is null.