fixed flag not working when __global__ didnt exist