fix permission hook, clean up file names