fixed bug about end event

fixed bug about end event