Added removal of players when tab is closed