Fix potential race condition in panel startup