flush stdout as well