Added reset logic