fixed retrieveMetadata