added deadline timer update to mainfunction