Changed ShellScriptUtil so thread waits for permission change to finish