Use flag variable