Fixed Memory Leak

Fixed a memory leak regarding opening multiple tabs.