rename files, set permissions correctly