Make cube loading thread save by putting an OpenMP critical directive around the call to load.