[#353] fixed a regression where onDestroyEvent was called after onResetEvent of the new state