making plugin write to file not append