Fixed TypeError while updating time