add validate method