fixed the bug where multiple keys are pressed