added logic to reset attributes to a valid state
handling attribute priority changes