Added function to check if running as root