corrected the error in accepting user input