public function for running validation