Event handler functions correct order