fix gsub error when a non-string is sent