fixed test to take the event order into account
fixed app to take the event order into account