fix empty device error