added switch for reading/writting