Added a parameter to control event firing

Added a parameter to control event firing