properly flush transaction log