Fixed error in class method