fix 'flags' scope