fixed the remove method for registration and adding a class.