fixed equals in InternalMetadata
added checking for double metadata in DB