fix for #12 for gpu-variant
final for #12