write to file for line 1 and single line is working.