npe and add idle check in plan