finally adding validation