use method_defined? to check for methods