remove and add classes dynamically