don't refer to result before set