add more check into set_device.
2 files changed