fix platform match bug, and modify handleWaitingTasks()