tightned up user input validation