Preventing crash on startup