add more input validation