modifications for gsub the old syntay depends on format encoding and could raise uncatched errors