fixed some reset logic