added validator to inputs