Fix bug of device wrap