fixing user input bug