added write to file if not able to add to couch