backward compatible fixes for new mongoengine