Added checking keyPress