added some more user input validation