fix bug causing `f` to not be evaluated in `upon`