add parameter for controling the event