catch TypeError and test