fix gsub condition