improve error handling: device not found.