use method_defined? to check whether or not a method is defined