Added flag variable