read till the end of the comm_file and check that line for ready instead of what happens to be the next line to be read.