register the custom constructor properly