Fixes permission error for flag-file