metadata encoding patch