copy strings before comparison