main_v: fixed bug at locating device first time