binding the class attribute with selected was causing problems