fix resorting to no longer break add and delete, generate document names