Store previous sorting

store the sorting from the previous window so that it looks (nearly) the same as when we left