sorting fix

Will now use date to sort by in composite key, eventually this will be changed to weight, but should be transparent to the client.