fix issuse: can not get device
merge code