Fixed wrong position of event triggering.