updated disposing event; see comments in function