fix reading metadata credentials