fixed cuda errors