replaced fail with panic