add onbeforeunload and unload event to prompt out Stay msg.