use flatMap to force evaluation at time of event