rework for reset logic