modified sorting of todos and its persistance