validate inputs on change