better device detection