change replacment string
replace typeof check with 'in' check
first testing shows, this isn't really fast :/