added some coed to manage event