Updated perms, changed how env vars are used