fix event firing order