made condition checking for updating timed tasks better