fixed for CUDA