change to use duplicate instead of string copy