fixed validateInput and also update