fix reset logic