fixed a bug on unsetMetadata()