connect to socket before loading app