check nil when close server conn
seems to be caused by looking up dns for a long time