fixed metadata handling