Add some input validation