Made changes to fix the event passing queue so that it works correctly.
Also fixed the test case.