fix reset conditions