fixed a uncaught error