fixing error to reset value on the wrong scope when unchecking option