replace `with` with `withSideEffect`