fixing $class variable