fix uncaught exceptions in doctor