fixed some errors of user input function