updated validate method