Fixed #9 by checking to see if flag exists before saving