a little input validation