Added device auto-detection