Added flag conditions for events