Added functoin to validate the method types