Adding new "after chat" cleanup function

Fix for #32 and #33 browser back & forward navigation