appending

Appending to ser file instead of overwrite.
also added the logging for the ith write.