workaround for weird doc-is-a-dict bug