call Close() if connection is dead