guard against permission denied error