fixing refreshMetadata error