fix bug with endData of events