update test to store result conditionally