To retry output finding 3 times and handle multile output case.