added metadata check