add auto sudo detect support