added fifo flushing