ensure flagstring is a string