fixed bug, was not ordering by time