added exception handling for permissions