JavaScript application crashes on getWatchToken() call