an example of session$onFlushed, but it does not seem to work...