Fixes https://www.commcarehq.org/couchlog/view/1d1e3e91181b3ee3768f6571e4e15429/