fixed event detach bug