Handling permission errors gracefully.