made the permissions in the script more independant