Added support to store order and direction between sessions