using lchenay's context fix for mongodb