implemented presence detection under firebase