Fix flush and removed logging