Fixed error introduces in refactoring out the user input handling