it is now writing only the last entry to the file