Fix incorrect variable in metadata fetch