validate inpute