Fix to DM-1015 to ensure that the result is created prior to failure