Fixed sorting by storing an object as a session variable