added a way to track socket listners added to the page to prevent memory leaks and duplicated definitions of events