added temp variables OnSignal, State.