replaced more $ with document.id()