fixed bug in setting text for flags