Fix initialisation race condition