Added  validation method.