fix bug with latestValue check
fix bug with latestValue check