making sure start and end classes are removed when selection changes