change gsub when possible