Modify the MAX_EVENTS_REPETITION to 100 for optimiation
Add some fixes for the next implementation and solve crash