fixed gsub bug