fixing the read_first_line function