added connecting info
Critical change, fixed bug, setTimeout was disabled on server.
Now added logic: window.document exists means client side