Adding timeout to scheduler.