fix sorting of activities