Bug fix on syncthreads