write FIFO to perfectly deal with IO