Fixed bug with keypresses