Fixed catchPanic bug