Fixed issue where the class was not being removed