Better handling of the selected attribute changes