fixed sub_idle module, fixed some bugs to run on an emulator.