small modifications to get fifo working more reliabily