Listen to the change of the 'selected' attribute - fix #6