added setter to Method to configure if the type of return value should be checked