fix occasional crash when starting