fix permission denied bug