loop in read from fifo