got everything funcitoning properly using device state class