Change 777 -R to -R 777