fix problem where stdout was not flushed properly
fix DAO UnitTest