fixed bug were deviced who were declared 'out of range' were set to default state again and again