fix error in spouse id handling