Some changes for socket connections