fixed ordering of records (was based on date as string)