Make history right after script finished.
Proper handling session selections