fixes a bug in the metadata factory