introduce input validation