Fix bug when delete entry then sort order isn't kept