Flushing Baskets from tree every 5000 events, modified