Fixed the script to make fixPermissions writable