detect_urls method