modified Thread.Sleep in EventBasedFlow