working socket with statemanager