fixed bug with store_append
Nail: re-wrote the code for logging user activity in javascript (added logging of the window close event)