Fixed a bug with event persistence