fixing the task scheduler