fix flag problem, sorta