Fixed bug in resetting latest value