remove error message: invalid socket
improve socket lib