fixed an uncaught exception