changed testing for the device to work with sudo