fixed metadata parser a bit