better debugging around setting metadata