updated device logic