fix issue can not get device
merge code