Updated userInput and sendtogui function