fix uncaught exception