Subscribes before calling onopen

Errors happens when you open another new connection with a namespace after establishing the connection.

Uncaught TypeError: Cannot call method 'push' of undefined 
Uncaught TypeError: Cannot read property 'length' of undefined