updating class properly