fix minor bug of device class API