adding error message to scan_ip and handling ip or selection target