wrapping all sudo calls in try statement