updated sudo handling