had to use an instance so changing the flags worked before the first call