fix bugs in user input