added read_all_loop