input validation and updating