Fix logic

Change-Id: I7bfb72e8bb245fab3e9a9d575abc7217bbae86d0
Fix socket

Change-Id: I0076010933c0edd3f5a0960ca55e02e5fff809be