re-enabled permission fix for main script