You clear it at the beginning, find...but it's likely not set at the beginning...
What happens when the flag gets set during program execution?
Refer to the datasheet!