sys_wait bug fixed