added device= method to set the device based on name or number