safe assignment for strings in setResult