fix nextUpdate logic