$newname is undefined