makes reindexing function private, calls aftersave