fix gsub to gsub! bug