function to change permission when running on grid