added more return type and parameters for validate method