fixs gsub bug