avoid changing sub to gsub (although not sure if matters)