changed gsub snippet