saving the flag as well.