changed setpermissions script