set last timestamp of state change