Added user input detection