wrong update device functin was being called