to fixup bug for seqential mouse and keyboard input