Working on connection state management