throw TypeError instead of returning undefined