throw TypeError instead of strings