fixed error in host.js where socket was not initalized fully before it was used