added conditions for gsub