fix bug that prevent to run demo properly in python