fixing event ordering