Fix bug in previous commit
Added sending information about socket state