setup event in apply