fix to test appropriate permissions and updated error message