fix keyEvent Bug
more functions