check on object type before calling class method