updated device variable handling