hopefully fixed the which occured when running in CUDA