fix uncaught error throwing.