actually fixed reset logic