add correct metadata handling