handle permission errors