calling class method correctly