fix occasional crash on startup