fixed a bug with reverting events