Fixed memory leaks when opening popups
Fixed a memory leak when we clear the table for realtime updates