get and save deviceid