Added possibility to disable periodic flushing