Add new flag variable for checking state