fix setting lastValue