fix bug on event + update the sample