replaced looping with halting when panic occurs or assertation fails