added sudo only where needed