fix device bug