better error handling when no device is available