adding validation method