added USE_SET_METADATA flag