added global flag parser