changed it so we only check for sudo rights once