crash logic