catch type errors