implement global flag