disconected socket will be remove
delete unused variables