fix time wraparound