replaced visible with selected and added classes