Fixing the keyevent