fixes file and directory permissions