fixed sorting by date