change permission and fix bug for path