close box when connection to target failed