Updated sort in controller for logs.