fixed cuda functions