added a null check on deleteSocket