fix NoneType does not have