added check for root privileges.