Added functionality to select the a device