null check for socket added