Tried fixing uncaught typeerror