Fix bug with wrong sort a timerecords