updated API to allow sudo