fixed event logic