Moved read_loop to correct section