fix "console Uncaught TypeError: Illegal invocation" error on chrome