Fix device id bug