added fflush after the write on a fd in the format output method