fix uncaught bug