Added ActiveFlags on main events & cleaning