Added validate method.