Avoiding issues caused when running the script as root by using sudo