fixed rule generate_events problem