fixed issue where saving doc created new doc