move sudo -v inside functions