Fix provisionig flag management

(cherry picked from commit 89133ee4f675e4d3beb5989f0b8fd2e4201b35b1)