fixing error with gsub