onFlushed also works for renderPlot()