throw TypeError if input not string