fix uncatched exceptions