adding connection parameter to validate method