Fix crash due to permission denied