remove useless files and change permission