Moved connection open to "open" method to make sure that the listener to the ready event is always added