better handling of user input