make max flag toggleable