fixes MongoEngine/mongoengine #589