Make valid_uuid to handle mongoengine bson ObjectId