cascade delete and sorting