added pivot saving feature