preventing crash