event buffering bug fix + test cases