add reset logic