Added keypress functionality