Add headless device handling logic