adding correct substrings in the fifo thread