Fix unnecessary calling sudo when password not entered