fix NoneType