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