fixed 2dcube pthreads