added disconnect button and processing more socket's states