Fixed bug with Socket disconnecting