updated controllers so sort works on login