Added read_flag flipping