solve Uncaught TypeError