Added reset conditions